Skip to main content
GET
/
api
/
call
/
batch-details
/
{id}
curl --location '{{baseUrl}}/api/call/batch-details/67def9053495307c718d9dfb?page=1&limit=10&sortBy=createdAt&sortOrder=desc' \
  --header 'Authorization: Bearer {{authToken}}'
{
  "message": "Calls fetched successfully",
  "status": true,
  "code": 200,
  "errorMessage": "",
  "data": {
    "batchId": "67def9053495307c718d9dfb",
    "batchName": "Marketing Campaign May 2025",
    "batchStatus": "active",
    "page": 1,
    "limit": 10,
    "total": 150,
    "totalPages": 15,
    "data": [
      {
        "_id": "64e5f12345abcdef11111111",
        "phoneNumber": "12125551234",
        "name": "Emily Davis",
        "account_id": "ACC-5678",
        "priority": "high",
        "phoneLogs": [
          {
            "callStatus": "completed",
            "callDuration": 120,
            "recordingUrl": "https://example.com/recording.mp3",
            "transcript": "Call transcript here...",
            "createdAt": "2025-05-15T14:30:00.000Z"
          }
        ],
        "createdAt": "2025-05-15T14:00:00.000Z"
      }
    ]
  }
}

Overview

Fetch detailed information for a single batch, including campaign metadata, status, and a paginated list of call records. This endpoint supports advanced filtering, sorting, and searching to help you analyze call data. Use it for monitoring execution from the dashboard or building custom analytics.

Prerequisites

  • Bearer token for an authenticated user who owns the batch.
  • The batch id you obtained during creation.

Request

Authorization
string
required
Bearer token for the authenticated user.
id
string
required
Batch identifier you want to inspect.
page
integer
default:"1"
Page number for paginated calls.
limit
integer
default:"10"
Maximum call records to return per page (default: 10).
filter
string
JSON stringified filter object to filter calls by specific fields. Example: {"callStatus":"completed"}.
sortBy
string
Field to sort by (e.g., “createdAt”).
sortOrder
string
default:"asc"
Sort order: “asc” for ascending or “desc” for descending.
Search term to filter calls across dynamic fields (e.g., customer name, phone number).
curl --location '{{baseUrl}}/api/call/batch-details/67def9053495307c718d9dfb?page=1&limit=10&sortBy=createdAt&sortOrder=desc' \
  --header 'Authorization: Bearer {{authToken}}'

Response

{
  "message": "Calls fetched successfully",
  "status": true,
  "code": 200,
  "errorMessage": "",
  "data": {
    "batchId": "67def9053495307c718d9dfb",
    "batchName": "Marketing Campaign May 2025",
    "batchStatus": "active",
    "page": 1,
    "limit": 10,
    "total": 150,
    "totalPages": 15,
    "data": [
      {
        "_id": "64e5f12345abcdef11111111",
        "phoneNumber": "12125551234",
        "name": "Emily Davis",
        "account_id": "ACC-5678",
        "priority": "high",
        "phoneLogs": [
          {
            "callStatus": "completed",
            "callDuration": 120,
            "recordingUrl": "https://example.com/recording.mp3",
            "transcript": "Call transcript here...",
            "createdAt": "2025-05-15T14:30:00.000Z"
          }
        ],
        "createdAt": "2025-05-15T14:00:00.000Z"
      }
    ]
  }
}
data
object
required
Contains batch metadata and paginated call records.
data.batchId
string
required
The batch identifier.
data.batchName
string
required
The name of the batch.
data.batchStatus
string
required
Current status of the batch (e.g., “active”, “completed”, “paused”).
data.page
integer
required
Current page number.
data.limit
integer
required
Number of records per page.
data.total
integer
required
Total number of calls in the batch matching the filter criteria.
data.totalPages
integer
required
Total number of pages available.
data.data
array[object]
required
Array of call records with enriched data including phone logs, recording URLs, and transcripts when available.

Error Handling

  • 400 Bad Request – Invalid batch ID format, invalid filter JSON, or query parameters out of range.
  • 404 Not Found – Batch not found or does not belong to the authenticated user.
  • 500 Internal Server Error – Failed to aggregate batch data; retry or contact support.
Advanced Features:
  • Filtering: Use the filter parameter with JSON to filter calls by specific fields from the phone logs
  • Sorting: Sort by any field using sortBy and control order with sortOrder
  • Searching: The search parameter performs a regex search across all dynamic string fields in call records
  • Phone logs are automatically included with each call record when available
For real-time monitoring, combine this endpoint with webhooks to track batch progress. Use filtering and sorting to identify specific call outcomes or issues.

Authorizations

Authorization
string
header
required

Bearer token authentication for workspace access

Path Parameters

id
string
required

Query Parameters

page
integer
default:1
limit
integer
default:10
filter
string
sortBy
string
sortOrder
enum<string>
default:asc
Available options:
asc,
desc

Response

Batch details fetched successfully